package com.xiaomi.controller;

import com.xiaomi.annotation.MyAutowired;
import com.xiaomi.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    //定义属性
    @MyAutowired
    @Qualifier("userServiceImpl3")
    private UserService userService;

//    @Autowired
//    public UserController(UserService userService) {
//        this.userService = userService;
//    }
//
//    @Autowired
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }
//
//    public UserController(@Autowired UserService userService) {
//        this.userService = userService;
//    }
    public void login() {
        System.out.println("controller层的login方法");
        userService.login();
    }

    public void login_identify(String username) {
        System.out.println("User " + username + " is trying to log in.");
        userService.login_identify(username);
    }
}
